public class code {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 0; i <= 99999; i++) {
            int temp = i;
            count = 0;
            while(temp % 10 != 0){
                count++;
                temp = temp / 10;
            }
            temp = i;

            int sum = 0;
            while(temp != 0){
                sum += Math.pow(temp % 10,count);
                temp /= 10;
            }
            if(sum == i)
                System.out.println(i+" 是一个仙花数");

        }
    }
}

